home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / comm / mail / YAM23src.lha / Source / YAM_COs.c < prev    next >
C/C++ Source or Header  |  2001-05-14  |  54KB  |  918 lines

  1. /***************************************************************************
  2.  
  3.  YAM - Yet Another Mailer
  4.  Copyright (C) 1995-2000 by Marcel Beck <mbeck@yam.ch>
  5.  Copyright (C) 2000-2001 by YAM Open Source Team
  6.  
  7.  This program is free software; you can redistribute it and/or modify
  8.  it under the terms of the GNU General Public License as published by
  9.  the Free Software Foundation; either version 2 of the License, or
  10.  (at your option) any later version.
  11.  
  12.  This program is distributed in the hope that it will be useful,
  13.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  GNU General Public License for more details.
  16.  
  17.  You should have received a copy of the GNU General Public License
  18.  along with this program; if not, write to the Free Software
  19.  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  20.  
  21.  YAM Official Support Site :  http://www.yam.ch
  22.  YAM OpenSource project    :  http://sourceforge.net/projects/yamos/
  23.  
  24.  $Id: YAM_COs.c,v 1.13.2.1 2001/05/14 19:58:53 laursen Exp $
  25.  
  26. ***************************************************************************/
  27.  
  28. #include "YAM.h"
  29.  
  30. /* local protos */
  31. LOCAL char *Bool2Txt(BOOL);
  32. LOCAL BOOL Txt2Bool(char*);
  33.  
  34. /***************************************************************************
  35.  Module: Configuration - Basic Get/Put routines
  36. ***************************************************************************/
  37.  
  38. /// Bool2Txt
  39. //  Converts boolean value to text
  40. LOCAL char *Bool2Txt(BOOL bool)
  41. {
  42.    return bool ? "Y" : "N";
  43. }
  44.  
  45. ///
  46. /// Txt2Bool
  47. //  Converts Y/N string to boolean value
  48. LOCAL BOOL Txt2Bool(char *txt)
  49. {
  50.    return (BOOL)(tolower((int)*txt) == 'y');
  51. }
  52. ///
  53. /// CO_SaveConfig
  54. //  Saves configuration to a file
  55. void CO_SaveConfig(struct Config *co, char *fname)
  56. {
  57.    FILE *fh;
  58.    int i;
  59.    
  60.    if (fh = fopen(fname, "w"))
  61.    {
  62.       fprintf(fh, "YCO3 - YAM Configuration\n");
  63.       fprintf(fh, "\n[First steps]\n");
  64.       fprintf(fh, "RealName         = %s\n", co->RealName);
  65.       fprintf(fh, "EmailAddress     = %s\n", co->EmailAddress);
  66.       fprintf(fh, "TimeZone         = %ld\n", co->TimeZone);
  67.       fprintf(fh, "DaylightSaving   = %s\n", Bool2Txt(co->DaylightSaving));
  68.       fprintf(fh, "\n[TCP/IP]\n");
  69.       fprintf(fh, "SMTP-Server      = %s\n", co->SMTP_Server);
  70.       fprintf(fh, "SMTP-Domain      = %s\n", co->SMTP_Domain);
  71.       fprintf(fh, "Allow8bit        = %s\n", Bool2Txt(co->Allow8bit));
  72.       fprintf(fh, "Use-SMTP-AUTH    = %s\n", Bool2Txt(co->Use_SMTP_AUTH));
  73.       fprintf(fh, "SMTP-AUTH-User   = %s\n", co->SMTP_AUTH_User);
  74.       fprintf(fh, "SMTP-AUTH-Pass   = %s\n", Encrypt(co->SMTP_AUTH_Pass));
  75.       for (i = 0; i < MAXP3; i++) if (co->P3[i])
  76.       {
  77.       struct POP3 *p3 = co->P3[i];
  78.       fprintf(fh, "POP%02ld.Server     = %s\n", i, p3->Server);
  79.       fprintf(fh, "POP%02ld.User       = %s\n", i, p3->User);
  80.       fprintf(fh, "POP%02ld.Password   = %s\n", i, Encrypt(p3->Password));
  81.       fprintf(fh, "POP%02ld.Enabled    = %s\n", i, Bool2Txt(p3->Enabled));
  82.       fprintf(fh, "POP%02ld.UseAPOP    = %s\n", i, Bool2Txt(p3->UseAPOP));
  83.       fprintf(fh, "POP%02ld.Delete     = %s\n", i, Bool2Txt(p3->DeleteOnServer));
  84.       }
  85.       fprintf(fh, "\n[New mail]\n");
  86.       fprintf(fh, "AvoidDuplicates  = %s\n", Bool2Txt(co->AvoidDuplicates));
  87.       fprintf(fh, "PreSelection     = %ld\n", co->PreSelection);
  88.       fprintf(fh, "TransferWindow   = %ld\n", co->TransferWindow);
  89.       fprintf(fh, "UpdateStatus     = %s\n", Bool2Txt(co->UpdateStatus));
  90.       fprintf(fh, "WarnSize         = %ld\n", co->WarnSize);
  91.       fprintf(fh, "CheckMailDelay   = %ld\n", co->CheckMailDelay);
  92.       fprintf(fh, "DownloadLarge    = %s\n", Bool2Txt(co->DownloadLarge));
  93.       fprintf(fh, "NotifyType       = %ld\n", co->NotifyType);
  94.       fprintf(fh, "NotifySound      = %s\n", co->NotifySound);
  95.       fprintf(fh, "NotifyCommand    = %s\n", co->NotifyCommand);
  96.       fprintf(fh, "\n[Filters]\n");
  97.       for (i = 0; i < MAXRU; i++) if (co->RU[i])
  98.       {
  99.       struct Rule *ru = co->RU[i];
  100.       fprintf(fh, "FI%02ld.Name        = %s\n", i, ru->Name);
  101.       fprintf(fh, "FI%02ld.Remote      = %s\n", i, Bool2Txt(ru->Remote));
  102.       fprintf(fh, "FI%02ld.ApplyToNew  = %s\n", i, Bool2Txt(ru->ApplyToNew));
  103.       fprintf(fh, "FI%02ld.ApplyToSent = %s\n", i, Bool2Txt(ru->ApplyToSent));
  104.       fprintf(fh, "FI%02ld.ApplyOnReq  = %s\n", i, Bool2Txt(ru->ApplyOnReq));
  105.       fprintf(fh, "FI%02ld.Field       = %ld\n", i, ru->Field[0]);
  106.       fprintf(fh, "FI%02ld.SubField    = %ld\n", i, ru->SubField[0]);
  107.       fprintf(fh, "FI%02ld.CustomField = %s\n", i, ru->CustomField[0]);
  108.       fprintf(fh, "FI%02ld.Comparison  = %ld\n", i, ru->Comparison[0]);
  109.       fprintf(fh, "FI%02ld.Match       = %s\n", i, ru->Match[0]);
  110.       fprintf(fh, "FI%02ld.CaseSens    = %s\n", i, Bool2Txt(ru->CaseSens[0]));
  111.       fprintf(fh, "FI%02ld.Substring   = %s\n", i, Bool2Txt(ru->Substring[0]));
  112.       fprintf(fh, "FI%02ld.Combine     = %ld\n", i, ru->Combine);
  113.       if (ru->Combine)
  114.       {
  115.          fprintf(fh, "FI%02ld.Field2      = %ld\n", i, ru->Field[1]);
  116.          fprintf(fh, "FI%02ld.SubField2   = %ld\n", i, ru->SubField[1]);
  117.          fprintf(fh, "FI%02ld.CustomField2= %s\n", i, ru->CustomField[1]);
  118.          fprintf(fh, "FI%02ld.Comparison2 = %ld\n", i, ru->Comparison[1]);
  119.          fprintf(fh, "FI%02ld.Match2      = %s\n", i, ru->Match[1]);
  120.          fprintf(fh, "FI%02ld.CaseSens2   = %s\n", i, Bool2Txt(ru->CaseSens[1]));
  121.          fprintf(fh, "FI%02ld.Substring2  = %s\n", i, Bool2Txt(ru->Substring[1]));
  122.       }
  123.       fprintf(fh, "FI%02ld.Actions     = %ld\n", i, ru->Actions);
  124.       fprintf(fh, "FI%02ld.BounceTo    = %s\n", i, ru->BounceTo);
  125.       fprintf(fh, "FI%02ld.ForwardTo   = %s\n", i, ru->ForwardTo);
  126.       fprintf(fh, "FI%02ld.ReplyFile   = %s\n", i, ru->ReplyFile);
  127.       fprintf(fh, "FI%02ld.ExecuteCmd  = %s\n", i, ru->ExecuteCmd);
  128.       fprintf(fh, "FI%02ld.PlaySound   = %s\n", i, ru->PlaySound);
  129.       fprintf(fh, "FI%02ld.MoveTo      = %s\n", i, ru->MoveTo);
  130.       }
  131.       fprintf(fh, "\n[Read]\n");
  132.       fprintf(fh, "ShowHeader       = %ld\n", co->ShowHeader);
  133.       fprintf(fh, "ShortHeaders     = %s\n", co->ShortHeaders);
  134.       fprintf(fh, "ShowSenderInfo   = %ld\n", co->ShowSenderInfo);
  135.       fprintf(fh, "WrapHeader       = %s\n", Bool2Txt(co->WrapHeader));
  136.       fprintf(fh, "SigSepLine       = %ld\n", co->SigSepLine);
  137.       fprintf(fh, "ColoredText      = %s\n", co->ColoredText.buf);
  138.       fprintf(fh, "Color2ndLevel    = %s\n", co->Color2ndLevel.buf);
  139.       fprintf(fh, "DisplayAllTexts  = %s\n", Bool2Txt(co->DisplayAllTexts));
  140.       fprintf(fh, "FixedFontEdit    = %s\n", Bool2Txt(co->FixedFontEdit));
  141.       fprintf(fh, "UseTextstyles    = %s\n", Bool2Txt(co->UseTextstyles));
  142.       fprintf(fh, "MultipleWindows  = %s\n", Bool2Txt(co->MultipleWindows));
  143.       fprintf(fh, "TranslationIn    = %s\n", co->TranslationIn);
  144.       fprintf(fh, "\n[Write]\n");
  145.       fprintf(fh, "ReplyTo          = %s\n", co->ReplyTo);
  146.       fprintf(fh, "Organization     = %s\n", co->Organization);
  147.       fprintf(fh, "ExtraHeaders     = %s\n", co->ExtraHeaders);
  148.       fprintf(fh, "NewIntro         = %s\n", co->NewIntro);
  149.       fprintf(fh, "Greetings        = %s\n", co->Greetings);
  150.       fprintf(fh, "TranslationOut   = %s\n", co->TranslationOut);
  151.       fprintf(fh, "EdWrapCol        = %ld\n", co->EdWrapCol);
  152.       fprintf(fh, "EdWrapMode       = %ld\n", co->EdWrapMode);
  153.       fprintf(fh, "Editor           = %s\n", co->Editor);
  154.       fprintf(fh, "LaunchAlways     = %s\n", Bool2Txt(co->LaunchAlways));
  155.       fprintf(fh, "\n[Reply/Forward]\n");
  156.       fprintf(fh, "ReplyHello       = %s\n", co->ReplyHello);
  157.       fprintf(fh, "ReplyIntro       = %s\n", co->ReplyIntro);
  158.       fprintf(fh, "ReplyBye         = %s\n", co->ReplyBye);
  159.       fprintf(fh, "AltReplyHello    = %s\n", co->AltReplyHello);
  160.       fprintf(fh, "AltReplyIntro    = %s\n", co->AltReplyIntro);
  161.       fprintf(fh, "AltReplyBye      = %s\n", co->AltReplyBye);
  162.       fprintf(fh, "AltReplyPattern  = %s\n", co->AltReplyPattern);
  163.       fprintf(fh, "MLReplyHello     = %s\n", co->MLReplyHello);
  164.       fprintf(fh, "MLReplyIntro     = %s\n", co->MLReplyIntro);
  165.       fprintf(fh, "MLReplyBye       = %s\n", co->MLReplyBye);
  166.       fprintf(fh, "ForwardIntro     = %s\n", co->ForwardIntro);
  167.       fprintf(fh, "ForwardFinish    = %s\n", co->ForwardFinish);
  168.       fprintf(fh, "QuoteMessage     = %s\n", Bool2Txt(co->QuoteMessage));
  169.       fprintf(fh, "QuoteText        = %s\n", co->QuoteText);
  170.       fprintf(fh, "AltQuoteText     = %s\n", co->AltQuoteText);
  171.       fprintf(fh, "QuoteEmptyLines  = %s\n", Bool2Txt(co->QuoteEmptyLines));
  172.       fprintf(fh, "CompareAddress   = %s\n", Bool2Txt(co->CompareAddress));
  173.       fprintf(fh, "StripSignature   = %s\n", Bool2Txt(co->StripSignature));
  174.       fprintf(fh, "\n[Signature]\n");
  175.       fprintf(fh, "UseSignature     = %s\n", Bool2Txt(co->UseSignature));
  176.       fprintf(fh, "TagsFile         = %s\n", co->TagsFile);
  177.       fprintf(fh, "TagsSeparator    = %s\n", co->TagsSeparator);
  178.       fprintf(fh, "\n[Lists]\n");
  179.       fprintf(fh, "FolderCols       = %ld\n", co->FolderCols);
  180.       fprintf(fh, "MessageCols      = %ld\n", co->MessageCols);
  181.       fprintf(fh, "FixedFontList    = %s\n", Bool2Txt(co->FixedFontList));
  182.       fprintf(fh, "SwatchBeat       = %s\n", Bool2Txt(co->SwatchBeat));
  183.       fprintf(fh, "\n[Security]\n");
  184.       fprintf(fh, "PGPCmdPath       = %s\n", co->PGPCmdPath);
  185.       fprintf(fh, "MyPGPID          = %s\n", co->MyPGPID);
  186.       fprintf(fh, "EncryptToSelf    = %s\n", Bool2Txt(co->EncryptToSelf));
  187.       fprintf(fh, "ReMailer         = %s\n", co->ReMailer);
  188.       fprintf(fh, "RMCommands       = %s\n", co->RMCommands);
  189.       fprintf(fh, "LogfilePath      = %s\n", co->LogfilePath);
  190.       fprintf(fh, "LogfileMode      = %ld\n", co->LogfileMode);
  191.       fprintf(fh, "SplitLogfile     = %s\n", Bool2Txt(co->SplitLogfile));
  192.       fprintf(fh, "LogAllEvents     = %s\n", Bool2Txt(co->LogAllEvents));
  193.       fprintf(fh, "\n[Start/Quit]\n");
  194.       fprintf(fh, "GetOnStartup     = %s\n", Bool2Txt(co->GetOnStartup));
  195.       fprintf(fh, "SendOnStartup    = %s\n", Bool2Txt(co->SendOnStartup));
  196.       fprintf(fh, "CleanupOnStartup = %s\n", Bool2Txt(co->CleanupOnStartup));
  197.       fprintf(fh, "RemoveOnStartup  = %s\n", Bool2Txt(co->RemoveOnStartup));
  198.       fprintf(fh, "LoadAllFolders   = %s\n", Bool2Txt(co->LoadAllFolders));
  199.       fprintf(fh, "UpdateNewMail    = %s\n", Bool2Txt(co->UpdateNewMail));
  200.       fprintf(fh, "CheckBirthdates  = %s\n", Bool2Txt(co->CheckBirthdates));
  201.       fprintf(fh, "SendOnQuit       = %s\n", Bool2Txt(co->SendOnQuit));
  202.       fprintf(fh, "CleanupOnQuit    = %s\n", Bool2Txt(co->CleanupOnQuit));
  203.       fprintf(fh, "RemoveOnQuit     = %s\n", Bool2Txt(co->RemoveOnQuit));
  204.       fprintf(fh, "\n[MIME]\n");
  205.       for (i = 0; i < MAXMV; i++) if (co->MV[i])
  206.       {
  207.       fprintf(fh, "MV%02ld.ContentType = %s\n", i, co->MV[i]->ContentType);
  208.       fprintf(fh, "MV%02ld.Extension   = %s\n", i, co->MV[i]->Extension);
  209.       fprintf(fh, "MV%02ld.Command     = %s\n", i, co->MV[i]->Command);
  210.       }
  211.       fprintf(fh, "IdentifyBin      = %s\n", Bool2Txt(co->IdentifyBin));
  212.       fprintf(fh, "DetachDir        = %s\n", co->DetachDir);
  213.       fprintf(fh, "AttachDir        = %s\n", co->AttachDir);
  214.       fprintf(fh, "\n[Address book]\n");
  215.       fprintf(fh, "GalleryDir       = %s\n", co->GalleryDir);
  216.       fprintf(fh, "MyPictureURL     = %s\n", co->MyPictureURL);
  217.       fprintf(fh, "ProxyServer      = %s\n", co->ProxyServer);
  218.       fprintf(fh, "NewAddrGroup     = %s\n", co->NewAddrGroup);
  219.       fprintf(fh, "AddToAddrbook    = %ld\n", co->AddToAddrbook);
  220.       fprintf(fh, "AddMyInfo        = %s\n", Bool2Txt(co->AddMyInfo));
  221.       fprintf(fh, "AddrbookCols     = %ld\n", co->AddrbookCols);
  222.       fprintf(fh, "\n[Scripts]\n");
  223.       for (i = 0; i < MAXRX; i++)
  224.       {
  225.       if (i < 10) fprintf(fh, "Rexx%02ld.Name      = %s\n", i, co->RX[i].Name);
  226.       fprintf(fh, "Rexx%02ld.Script    = %s\n", i, co->RX[i].Script);
  227.       fprintf(fh, "Rexx%02ld.IsAmigaDOS= %s\n", i, Bool2Txt(co->RX[i].IsAmigaDOS));
  228.       fprintf(fh, "Rexx%02ld.UseConsole= %s\n", i, Bool2Txt(co->RX[i].UseConsole));
  229.       fprintf(fh, "Rexx%02ld.WaitTerm  = %s\n", i, Bool2Txt(co->RX[i].WaitTerm));
  230.       }
  231.       fprintf(fh, "\n[Mixed]\n");
  232.       fprintf(fh, "TempDir          = %s\n", co->TempDir);
  233.       fprintf(fh, "IconPosition     = %ld;%ld\n", co->IconPositionX, co->IconPositionY);
  234.       fprintf(fh, "IconifyOnQuit    = %s\n", Bool2Txt(co->IconifyOnQuit));
  235.       fprintf(fh, "Confirm          = %s\n", Bool2Txt(co->Confirm));
  236.       fprintf(fh, "ConfirmDelete    = %ld\n", co->ConfirmDelete);
  237.       fprintf(fh, "RemoveAtOnce     = %s\n", Bool2Txt(co->RemoveAtOnce));
  238.       fprintf(fh, "SaveSent         = %s\n", Bool2Txt(co->SaveSent));
  239.       fprintf(fh, "MDN_Display      = %ld\n", co->MDN_Display);
  240.       fprintf(fh, "MDN_Process      = %ld\n", co->MDN_Process);
  241.       fprintf(fh, "MDN_Delete       = %ld\n", co->MDN_Delete);
  242.       fprintf(fh, "MDN_Filter       = %ld\n", co->MDN_Filter);
  243.       fprintf(fh, "SendMDNAtOnce    = %s\n", Bool2Txt(co->SendMDNAtOnce));
  244.       fprintf(fh, "XPKPack          = %s;%ld\n", co->XPKPack, co->XPKPackEff);
  245.       fprintf(fh, "XPKPackEncrypt   = %s;%ld\n", co->XPKPackEncrypt, co->XPKPackEncryptEff);
  246.       fprintf(fh, "PackerCommand    = %s\n", co->PackerCommand);
  247.       fprintf(fh, "\n[Advanced]\n");
  248.       fprintf(fh, "LetterPart       = %ld\n", co->LetterPart);
  249.       fprintf(fh, "WriteIndexes     = %ld\n", co->WriteIndexes);
  250.       fprintf(fh, "AutoSave         = %ld\n", co->AutoSave);
  251.       fprintf(fh, "SupportSite      = %s\n", co->SupportSite);
  252.       fprintf(fh, "JumpToNewMsg     = %s\n", Bool2Txt(co->JumpToNewMsg));
  253.       fprintf(fh, "AskJumpUnread    = %s\n", Bool2Txt(co->AskJumpUnread));
  254.       fprintf(fh, "WarnSubject      = %s\n", Bool2Txt(co->WarnSubject));
  255.       fprintf(fh, "PrinterCheck     = %s\n", Bool2Txt(co->PrinterCheck));
  256.       fprintf(fh, "IsOnlineCheck    = %s\n", Bool2Txt(co->IsOnlineCheck));
  257.       fprintf(fh, "IOCInterface     = %s\n", co->IOCInterface);
  258.       fprintf(fh, "ConfirmOnQuit    = %s\n", Bool2Txt(co->ConfirmOnQuit));
  259.       fprintf(fh, "HideGUIElements  = %ld\n", co->HideGUIElements);
  260.       fprintf(fh, "LocalCharset     = %s\n", co->LocalCharset);
  261.       fprintf(fh, "StackSize        = %ld\n", co->StackSize);
  262.       fprintf(fh, "PrintMethod      = %ld\n", co->PrintMethod);
  263.       fclose(fh);
  264.       AppendLogVerbose(60, GetStr(MSG_LOG_SavingConfig), fname, "", "", "");
  265.    }
  266.    else ER_NewError(GetStr(MSG_ER_CantCreateFile), fname, NULL);
  267. }
  268.  
  269. ///
  270. /// CO_LoadConfig
  271. //  Loads configuration from a file
  272. BOOL CO_LoadConfig(struct Config *co, char *fname, struct Folder ***oldfolders)
  273. {
  274.    struct Folder **ofo = NULL;
  275.    FILE *fh;
  276.    char buffer[SIZE_LARGE];
  277.    int version;
  278.    
  279.    if (fh = fopen(fname, "r"))
  280.    {
  281.       fgets(buffer, SIZE_LARGE, fh);
  282.       if (!Strnicmp(buffer, "YCO", 3))
  283.       {
  284.          version = buffer[3]-'0';
  285.          CO_SetDefaults(co, -1);
  286.          while (fgets(buffer, SIZE_LARGE, fh))
  287.          {
  288.             char *p, *p2, *value, *value2 = "";
  289.             if (value = strchr(buffer, '=')) for (value2 = (++value)+1; ISpace(*value); value++);
  290.             if (p = strpbrk(buffer,"\r\n")) *p = 0;
  291.             for (p = buffer; *p && *p != '=' && !ISpace(*p); p++); *p = 0;
  292.             if (*buffer && value)
  293.             {
  294.                if (version == 2)
  295.                {
  296.                   if (!stricmp(buffer, "POP3-Server"))    stccpy(co->P3[0]->Server, value, SIZE_HOST);
  297.                   if (!stricmp(buffer, "POP3-Password"))  stccpy(co->P3[0]->Password, Decrypt(value), SIZE_PASSWORD);
  298.                   if (!stricmp(buffer, "POP3-User"))      stccpy(co->P3[0]->User, value, SIZE_USERID);
  299.                   if (!stricmp(buffer, "DeleteOnServer")) co->P3[0]->DeleteOnServer = Txt2Bool(value);
  300.                   if (!stricmp(buffer, "CheckMail"))      if (!Txt2Bool(value)) co->CheckMailDelay = 0;
  301.                   if (!stricmp(buffer, "ConfirmSize")) switch (atoi(value))
  302.                   {
  303.                      case  0: co->PreSelection = 2; co->WarnSize = 0; break;
  304.                      case 13: co->PreSelection = 0; co->WarnSize = 0; break;
  305.                      default: co->PreSelection = 1; co->WarnSize = 1<<atoi(value); break;
  306.                   }
  307.                   if (!stricmp(buffer, "Verbosity"))      co->TransferWindow = atoi(value) > 0 ? 2 : 0;
  308.                   if (!stricmp(buffer, "WordWrap"))       co->EdWrapCol = atoi(value);
  309.                   if (!stricmp(buffer, "DeleteOnExit"))   co->RemoveAtOnce = !(co->RemoveOnQuit = Txt2Bool(value));
  310.                   if (!strnicmp(buffer, "Folder", 6) && oldfolders)
  311.                   {
  312.                      static int sortconv[4] = { -1, 1, 3, 5 };
  313.                      int j = atoi(&buffer[6]), type;
  314.                      if (!ofo) ofo = *oldfolders = calloc(100, sizeof(struct Folder *));
  315.                      if (j >= 3) for (j = 4; j < 100; j++) if (!ofo[j]) break;
  316.                      type = (j == 0 ? FT_INCOMING : (j == 1 ? FT_OUTGOING : (j == 2 ? FT_SENT : FT_CUSTOM)));
  317.                      p = strchr(&value[4], ';'); *p++ = 0;
  318.                      if (!ofo[j]) if (ofo[j] = FO_NewFolder(type, &value[4], p)) ofo[j]->Sort[0] = sortconv[atoi(&value[2])];
  319.                   }
  320.                   if (!strnicmp(buffer, "Rule", 4))
  321.                   {
  322.                      int j = atoi(&buffer[4]);
  323.                      struct Rule *ru = co->RU[j];
  324.                      if (!ru) ru = co->RU[j] = CO_NewRule();
  325.                      ru->ApplyToNew = ru->ApplyOnReq = Txt2Bool(value);
  326.                      p = strchr(p2 = &value[2], ';'); *p++ = 0;
  327.                      stccpy(ru->Name, p2, SIZE_NAME);
  328.                      if ((ru->Field[0] = atoi(p)) == 2) ru->Field[0] = 4;
  329.                      ru->CaseSens[0] = Txt2Bool(&p[2]);
  330.                      ru->Comparison[0] = Txt2Bool(&p[4]) ? 1 : 0;
  331.                      p = strchr(p2 = &p[6], ';'); *p++ = 0;
  332.                      stccpy(ru->Match[0], p2, SIZE_PATTERN);
  333.                      switch (atoi(p))
  334.                      {
  335.                         case 0: ru->Actions = 32; break;
  336.                         case 1: ru->Actions = 64; break;
  337.                         case 2: ru->Actions = 2; break;
  338.                      }
  339.                      p = strchr(p2 = &p[2], ';'); *p++ = 0;
  340.                      stccpy(ru->MoveTo, p2, SIZE_NAME);
  341.                      stccpy(ru->ForwardTo, p, SIZE_ADDRESS);
  342.                      if (*ru->ForwardTo) ru->Actions |= 2;
  343.                   }
  344.                   if (!strnicmp(buffer, "MimeViewer", 10))
  345.                   {
  346.                      int j = atoi(&buffer[10]);
  347.                      struct MimeView *mv = co->MV[j];
  348.                      if (!mv) mv = co->MV[j] = CO_NewMimeView();
  349.                      p = strchr(value, ';'); *p++ = 0;
  350.                      stccpy(mv->ContentType, value, SIZE_CTYPE);
  351.                      stccpy(mv->Command, p, SIZE_COMMAND);
  352.                   }
  353.                   if (!Strnicmp(buffer, "RexxMenu", 8))
  354.                   {
  355.                      int j = atoi(&buffer[8]);
  356.                      stccpy(co->RX[j].Name, FilePart(value), SIZE_NAME);
  357.                      stccpy(co->RX[j].Script, value, SIZE_PATHFILE);
  358.                   }
  359.                }
  360.                if (!strnicmp(buffer, "FolderPath", 10) && oldfolders)
  361.                {
  362.                   int j = atoi(&buffer[10]);
  363.                   if (!ofo) ofo = *oldfolders = calloc(100, sizeof(struct Folder *));
  364.                   if (!ofo[j]) ofo[j] = FO_NewFolder(FT_CUSTOM, value, FilePart(value));
  365.                   if (!FO_LoadConfig(ofo[j])) FO_SaveConfig(ofo[j]);
  366.                }
  367. /*0*/          if (!stricmp(buffer, "RealName"))       stccpy(co->RealName, value, SIZE_REALNAME);
  368.                if (!stricmp(buffer, "EmailAddress"))   stccpy(co->EmailAddress, value, SIZE_ADDRESS);
  369.  
  370.                if (!stricmp(buffer, "TimeZone"))
  371.                {
  372.                    /* If Locale is present, don't use the timezone from the config */
  373.                    if (G->Locale)
  374.                  {
  375.                       CloseLocale(G->Locale);
  376.                       G->Locale = OpenLocale(NULL);
  377.                       co->TimeZone = -G->Locale->loc_GMTOffset/60;
  378.                    }else
  379.                  {
  380.                             co->TimeZone = atoi(value);
  381.                                  }
  382.                }
  383.  
  384.                if (!stricmp(buffer, "DaylightSaving")) co->DaylightSaving = Txt2Bool(value);
  385. /*1*/          if (!stricmp(buffer, "SMTP-Server"))    stccpy(co->SMTP_Server, value, SIZE_HOST);
  386.                if (!stricmp(buffer, "SMTP-Domain"))    stccpy(co->SMTP_Domain, value, SIZE_HOST);
  387.                if (!stricmp(buffer, "Allow8bit"))      co->Allow8bit = Txt2Bool(value);
  388.                if (!stricmp(buffer, "Use-SMTP-AUTH"))  co->Use_SMTP_AUTH = Txt2Bool(value);
  389.                if (!stricmp(buffer, "SMTP-AUTH-User")) stccpy(co->SMTP_AUTH_User, value, SIZE_USERID);
  390.                if (!stricmp(buffer, "SMTP-AUTH-Pass")) stccpy(co->SMTP_AUTH_Pass, Decrypt(value), SIZE_USERID);
  391.                if (!strnicmp(buffer, "POP", 3) && buffer[5] == '.')
  392.                {
  393.                   int j = atoi(&buffer[3]);
  394.                   struct POP3 *p3 = co->P3[j];
  395.                   p = &buffer[6];
  396.                   if (!p3) p3 = co->P3[j] = CO_NewPOP3(co, FALSE);
  397.                   if (!stricmp(p, "Server"))    stccpy(p3->Server, value, SIZE_HOST);
  398.                   if (!stricmp(p, "Password"))  stccpy(p3->Password, Decrypt(value), SIZE_PASSWORD);
  399.                   if (!stricmp(p, "User"))      stccpy(p3->User, value, SIZE_USERID);
  400.                   if (!stricmp(p, "Enabled"))   p3->Enabled = Txt2Bool(value);
  401.                   if (!stricmp(p, "UseAPOP"))   p3->UseAPOP = Txt2Bool(value);
  402.                   if (!stricmp(p, "Delete"))    p3->DeleteOnServer = Txt2Bool(value);
  403.                }
  404. /*2*/          if (!stricmp(buffer, "AvoidDuplicates"))co->AvoidDuplicates = Txt2Bool(value);
  405.                if (!stricmp(buffer, "PreSelection"))   co->PreSelection = atoi(value);
  406.                if (!stricmp(buffer, "TransferWindow")) co->TransferWindow = atoi(value);
  407.                if (!stricmp(buffer, "UpdateStatus"))   co->UpdateStatus = Txt2Bool(value);
  408.                if (!stricmp(buffer, "WarnSize"))       co->WarnSize = atoi(value);
  409.                if (!stricmp(buffer, "CheckMailDelay")) co->CheckMailDelay = atoi(value);
  410.                if (!stricmp(buffer, "DownloadLarge"))  co->DownloadLarge = Txt2Bool(value);
  411.                if (!stricmp(buffer, "NotifyType"))     co->NotifyType = atoi(value);
  412.                if (!stricmp(buffer, "NotifySound"))    stccpy(co->NotifySound, value, SIZE_COMMAND);
  413.                if (!stricmp(buffer, "NotifyCommand"))  stccpy(co->NotifyCommand, value, SIZE_COMMAND);
  414. /*3*/          if (!strnicmp(buffer, "FI", 2) && buffer[4] == '.')
  415.                {
  416.                   int j = atoi(&buffer[2]);
  417.                   struct Rule *ru = co->RU[j];
  418.                   p = &buffer[5];
  419.                   if (!ru) ru = co->RU[j] = CO_NewRule();
  420.                   if (!stricmp(p, "Name"))       stccpy(ru->Name, value, SIZE_NAME);
  421.                   if (!stricmp(p, "Remote"))     ru->Remote = Txt2Bool(value);
  422.                   if (!stricmp(p, "ApplyToNew")) ru->ApplyToNew = Txt2Bool(value);
  423.                   if (!stricmp(p, "ApplyToSent"))ru->ApplyToSent = Txt2Bool(value);
  424.                   if (!stricmp(p, "ApplyOnReq")) ru->ApplyOnReq = Txt2Bool(value);
  425.                   if (!strnicmp(p, "Field", 5))       ru->Field[p[5]=='2'] = atoi(value);
  426.                   if (!strnicmp(p, "SubField", 8))    ru->SubField[p[8]=='2'] = atoi(value);
  427.                   if (!strnicmp(p, "CustomField", 11)) stccpy(ru->CustomField[p[11]=='2'], value, SIZE_DEFAULT);
  428.                   if (!strnicmp(p, "Comparison", 10)) ru->Comparison[p[10]=='2'] = atoi(value);
  429.                   if (!strnicmp(p, "Match", 5))       stccpy(ru->Match[p[5]=='2'], value2, SIZE_PATTERN);
  430.                   if (!strnicmp(p, "CaseSens", 8))    ru->CaseSens[p[8]=='2'] = Txt2Bool(value);
  431.                   if (!strnicmp(p, "Substring", 9))   ru->Substring[p[9]=='2'] = Txt2Bool(value);
  432.                   if (!stricmp(p, "Combine"))    ru->Combine = atoi(value);
  433.                   if (!stricmp(p, "Actions"))    ru->Actions = atoi(value);
  434.                   if (!stricmp(p, "BounceTo"))   stccpy(ru->BounceTo, value, SIZE_ADDRESS);
  435.                   if (!stricmp(p, "ForwardTo"))  stccpy(ru->ForwardTo, value, SIZE_ADDRESS);
  436.                   if (!stricmp(p, "ReplyFile"))  stccpy(ru->ReplyFile, value, SIZE_PATHFILE);
  437.                   if (!stricmp(p, "ExecuteCmd")) stccpy(ru->ExecuteCmd, value, SIZE_COMMAND);
  438.                   if (!stricmp(p, "PlaySound"))  stccpy(ru->PlaySound, value, SIZE_PATHFILE);
  439.                   if (!stricmp(p, "MoveTo"))     stccpy(ru->MoveTo, value, SIZE_NAME);
  440.                }
  441. /*4*/          if (!stricmp(buffer, "ShowHeader"))     co->ShowHeader = atoi(value);
  442.                if (!stricmp(buffer, "ShortHeaders"))   stccpy(co->ShortHeaders, value, SIZE_PATTERN);
  443.                if (!stricmp(buffer, "ShowSenderInfo")) co->ShowSenderInfo = atoi(value);
  444.                if (!stricmp(buffer, "WrapHeader"))     co->WrapHeader = Txt2Bool(value);
  445.                if (!stricmp(buffer, "SigSepLine"))     co->SigSepLine = atoi(value);
  446.                if (!stricmp(buffer, "ColoredText"))    stccpy(co->ColoredText.buf, value, 32);
  447.                if (!stricmp(buffer, "Color2ndLevel"))  stccpy(co->Color2ndLevel.buf, value, 32);
  448.                if (!stricmp(buffer, "DisplayAllTexts"))co->DisplayAllTexts = Txt2Bool(value);
  449.                if (!stricmp(buffer, "FixedFontEdit"))  co->FixedFontEdit = Txt2Bool(value);
  450.                if (!stricmp(buffer, "UseTextstyles"))  co->UseTextstyles = Txt2Bool(value);
  451.                if (!stricmp(buffer, "MultipleWindows"))co->MultipleWindows = Txt2Bool(value);
  452.                if (!stricmp(buffer, "TranslationIn"))  stccpy(co->TranslationIn, value, SIZE_PATHFILE);
  453. /*5*/          if (!stricmp(buffer, "ReplyTo"))        stccpy(co->ReplyTo,  value, SIZE_ADDRESS);
  454.                if (!stricmp(buffer, "Organization"))   stccpy(co->Organization, value, SIZE_DEFAULT);
  455.                if (!stricmp(buffer, "ExtraHeaders"))   stccpy(co->ExtraHeaders, value, SIZE_LARGE);
  456.                if (!stricmp(buffer, "NewIntro"))       stccpy(co->NewIntro, value2, SIZE_INTRO);
  457.                if (!stricmp(buffer, "Greetings"))      stccpy(co->Greetings, value2, SIZE_INTRO);
  458.                if (!stricmp(buffer, "TranslationOut")) stccpy(co->TranslationOut, value, SIZE_PATHFILE);
  459.                if (!stricmp(buffer, "EdWrapCol"))      co->EdWrapCol = atoi(value);
  460.                if (!stricmp(buffer, "EdWrapMode"))     co->EdWrapMode = atoi(value);
  461.                if (!stricmp(buffer, "Editor"))         stccpy(co->Editor, value, SIZE_PATHFILE);
  462.                if (!stricmp(buffer, "LaunchAlways"))   co->LaunchAlways = Txt2Bool(value);
  463. /*6*/          if (!stricmp(buffer, "ReplyHello"))     stccpy(co->ReplyHello, value2, SIZE_INTRO);
  464.                if (!stricmp(buffer, "ReplyIntro"))     stccpy(co->ReplyIntro, value2, SIZE_INTRO);
  465.                if (!stricmp(buffer, "ReplyBye"))       stccpy(co->ReplyBye, value2, SIZE_INTRO);
  466.                if (!stricmp(buffer, "AltReplyHello"))  stccpy(co->AltReplyHello, value2, SIZE_INTRO);
  467.                if (!stricmp(buffer, "AltReplyIntro"))  stccpy(co->AltReplyIntro, value2, SIZE_INTRO);
  468.                if (!stricmp(buffer, "AltReplyBye"))    stccpy(co->AltReplyBye, value2, SIZE_INTRO);
  469.                if (!stricmp(buffer, "AltReplyPattern"))stccpy(co->AltReplyPattern, value2, SIZE_PATTERN);
  470.                if (!stricmp(buffer, "MLReplyHello"))   stccpy(co->MLReplyHello, value2, SIZE_INTRO);
  471.                if (!stricmp(buffer, "MLReplyIntro"))   stccpy(co->MLReplyIntro, value2, SIZE_INTRO);
  472.                if (!stricmp(buffer, "MLReplyBye"))     stccpy(co->MLReplyBye, value2, SIZE_INTRO);
  473.                if (!stricmp(buffer, "ForwardIntro"))   stccpy(co->ForwardIntro, value2, SIZE_INTRO);
  474.                if (!stricmp(buffer, "ForwardFinish"))  stccpy(co->ForwardFinish, value2, SIZE_INTRO);
  475.                if (!stricmp(buffer, "QuoteMessage"))   co->QuoteMessage = Txt2Bool(value);
  476.                if (!stricmp(buffer, "QuoteText"))      stccpy(co->QuoteText, value2, SIZE_SMALL);
  477.                if (!stricmp(buffer, "AltQuoteText"))   stccpy(co->AltQuoteText, value2, SIZE_SMALL);
  478.                if (!stricmp(buffer, "QuoteEmptyLines"))co->QuoteEmptyLines = Txt2Bool(value);
  479.                if (!stricmp(buffer, "CompareAddress")) co->CompareAddress = Txt2Bool(value);
  480.                if (!stricmp(buffer, "StripSignature")) co->StripSignature = Txt2Bool(value);
  481. /*7*/          if (!stricmp(buffer, "UseSignature"))   co->UseSignature = Txt2Bool(value);
  482.                if (!stricmp(buffer, "TagsFile"))       stccpy(co->TagsFile, value, SIZE_PATHFILE);
  483.                if (!stricmp(buffer, "TagsSeparator"))  stccpy(co->TagsSeparator, value2, SIZE_SMALL);
  484. /*8*/          if (!stricmp(buffer, "FolderCols"))     co->FolderCols = atoi(value);
  485.                if (!stricmp(buffer, "MessageCols"))    co->MessageCols = atoi(value);
  486.                if (!stricmp(buffer, "FixedFontList"))  co->FixedFontList = Txt2Bool(value);
  487.                if (!stricmp(buffer, "SwatchBeat"))     co->SwatchBeat = Txt2Bool(value);
  488. /*9*/          if (!stricmp(buffer, "PGPCmdPath"))     stccpy(co->PGPCmdPath, value, SIZE_PATH);
  489.                if (!stricmp(buffer, "MyPGPID"))        stccpy(co->MyPGPID, value, SIZE_DEFAULT);
  490.                if (!stricmp(buffer, "EncryptToSelf"))  co->EncryptToSelf = Txt2Bool(value);
  491.                if (!stricmp(buffer, "ReMailer"))       stccpy(co->ReMailer, value, SIZE_ADDRESS);
  492.                if (!stricmp(buffer, "RMCommands"))     stccpy(co->RMCommands, value2, SIZE_INTRO);
  493.                if (!stricmp(buffer, "LogfilePath"))    stccpy(co->LogfilePath, value, SIZE_PATH);
  494.                if (!stricmp(buffer, "LogfileMode"))    co->LogfileMode = atoi(value);
  495.                if (!stricmp(buffer, "SplitLogfile"))   co->SplitLogfile = Txt2Bool(value);
  496.                if (!stricmp(buffer, "LogAllEvents"))   co->LogAllEvents = Txt2Bool(value);
  497. /*10*/         if (!stricmp(buffer, "GetOnStartup"))   co->GetOnStartup = Txt2Bool(value);
  498.                if (!stricmp(buffer, "SendOnStartup"))  co->SendOnStartup = Txt2Bool(value);
  499.                if (!stricmp(buffer, "CleanupOnStartup")) co->CleanupOnStartup = Txt2Bool(value);
  500.                if (!stricmp(buffer, "RemoveOnStartup"))  co->RemoveOnStartup = Txt2Bool(value);
  501.                if (!stricmp(buffer, "LoadAllFolders")) co->LoadAllFolders = Txt2Bool(value);
  502.                if (!stricmp(buffer, "UpdateNewMail"))  co->UpdateNewMail = Txt2Bool(value);
  503.                if (!stricmp(buffer, "CheckBirthdates"))co->CheckBirthdates = Txt2Bool(value);
  504.                if (!stricmp(buffer, "SendOnQuit"))     co->SendOnQuit = Txt2Bool(value);
  505.                if (!stricmp(buffer, "CleanupOnQuit"))  co->CleanupOnQuit = Txt2Bool(value);
  506.                if (!stricmp(buffer, "RemoveOnQuit"))   co->RemoveOnQuit = Txt2Bool(value);
  507. /*11*/         if (!strnicmp(buffer, "MV", 2) && buffer[4] == '.')
  508.                {
  509.                   int j = atoi(&buffer[2]);
  510.                   struct MimeView *mv = co->MV[j];
  511.                   p = &buffer[5];
  512.                   if (!mv) mv = co->MV[j] = CO_NewMimeView();
  513.                   if (!stricmp(p, "ContentType")) stccpy(mv->ContentType, value, SIZE_CTYPE);
  514.                   if (!stricmp(p, "Extension"))   stccpy(mv->Extension, value, SIZE_NAME);
  515.                   if (!stricmp(p, "Command"))     stccpy(mv->Command, value, SIZE_COMMAND);
  516.                }
  517.                if (!stricmp(buffer, "IdentifyBin"))    co->IdentifyBin = Txt2Bool(value);
  518.                if (!stricmp(buffer, "DetachDir"))      stccpy(co->DetachDir, value, SIZE_PATH);
  519.                if (!stricmp(buffer, "AttachDir"))      stccpy(co->AttachDir, value, SIZE_PATH);
  520. /*12*/
  521.                if (!stricmp(buffer, "GalleryDir"))     stccpy(co->GalleryDir, value, SIZE_PATH);
  522.                if (!stricmp(buffer, "MyPictureURL"))   stccpy(co->MyPictureURL, value, SIZE_URL);
  523.                if (!stricmp(buffer, "ProxyServer"))    stccpy(co->ProxyServer, value, SIZE_HOST);
  524.                if (!stricmp(buffer, "NewAddrGroup"))   stccpy(co->NewAddrGroup, value, SIZE_NAME);
  525.                if (!stricmp(buffer, "AddToAddrbook"))  co->AddToAddrbook = atoi(value);
  526.                if (!stricmp(buffer, "AddMyInfo")    )  co->AddMyInfo= Txt2Bool(value);
  527.                if (!stricmp(buffer, "AddrbookCols"))   co->AddrbookCols = atoi(value);
  528. /*13*/         if (!strnicmp(buffer, "Rexx", 4) && buffer[6] == '.')
  529.                {
  530.                   int j = atoi(&buffer[4]);
  531.                   if (j < MAXRX)
  532.                   {
  533.                      p = &buffer[7];
  534.                      if (!stricmp(p, "Name"))       stccpy(co->RX[j].Name, value, SIZE_NAME);
  535.                      if (!stricmp(p, "Script"))     stccpy(co->RX[j].Script, value, SIZE_PATHFILE);
  536.                      if (!stricmp(p, "IsAmigaDOS")) co->RX[j].IsAmigaDOS = Txt2Bool(value);
  537.                      if (!stricmp(p, "UseConsole")) co->RX[j].UseConsole = Txt2Bool(value);
  538.                      if (!stricmp(p, "WaitTerm"))   co->RX[j].WaitTerm = Txt2Bool(value);
  539.                   }
  540.                }
  541. /*14*/         if (!stricmp(buffer, "TempDir"))        stccpy(co->TempDir, value, SIZE_PATH);
  542.                if (!stricmp(buffer, "IconPosition"))   sscanf(value, "%ld;%ld", &(co->IconPositionX), &(co->IconPositionY));
  543.                if (!stricmp(buffer, "IconifyOnQuit"))  co->IconifyOnQuit = Txt2Bool(value);
  544.                if (!stricmp(buffer, "Confirm"))        co->Confirm = Txt2Bool(value);
  545.                if (!stricmp(buffer, "ConfirmDelete"))  co->ConfirmDelete = atoi(value);
  546.                if (!stricmp(buffer, "RemoveAtOnce"))   co->RemoveAtOnce = Txt2Bool(value);
  547.                if (!stricmp(buffer, "SaveSent"))       co->SaveSent = Txt2Bool(value);
  548.                if (!stricmp(buffer, "MDN_Display"))    co->MDN_Display = atoi(value);
  549.                if (!stricmp(buffer, "MDN_Process"))    co->MDN_Process = atoi(value);
  550.                if (!stricmp(buffer, "MDN_Delete"))     co->MDN_Delete = atoi(value);
  551.                if (!stricmp(buffer, "MDN_Filter"))     co->MDN_Filter = atoi(value);
  552.                if (!stricmp(buffer, "SendMDNAtOnce"))  co->SendMDNAtOnce = Txt2Bool(value);
  553.                if (!stricmp(buffer, "XPKPack"))        { stccpy(co->XPKPack, value, 5); co->XPKPackEff = atoi(&value[5]); }
  554.                if (!stricmp(buffer, "XPKPackEncrypt")) { stccpy(co->XPKPackEncrypt, value, 5); co->XPKPackEncryptEff = atoi(&value[5]); }
  555.                if (!stricmp(buffer, "PackerCommand"))  stccpy(co->PackerCommand, value, SIZE_COMMAND);              
  556. /*Hidden*/     if (!stricmp(buffer, "LetterPart"))     co->LetterPart = atoi(value);
  557.                if (!stricmp(buffer, "WriteIndexes"))   co->WriteIndexes = atoi(value);
  558.                if (!stricmp(buffer, "AutoSave"))       co->AutoSave = atoi(value);
  559.                if (!stricmp(buffer, "SupportSite"))    stccpy(co->SupportSite, value, SIZE_HOST);
  560.                if (!stricmp(buffer, "JumpToNewMsg"))   co->JumpToNewMsg = Txt2Bool(value);
  561.                if (!stricmp(buffer, "AskJumpUnread"))  co->AskJumpUnread = Txt2Bool(value);
  562.                if (!stricmp(buffer, "WarnSubject"))    co->WarnSubject = Txt2Bool(value);
  563.                if (!stricmp(buffer, "PrinterCheck"))   co->PrinterCheck = Txt2Bool(value);
  564.                if (!stricmp(buffer, "IsOnlineCheck"))  co->IsOnlineCheck = Txt2Bool(value);
  565.                if (!stricmp(buffer, "IOCInterface"))   stccpy(co->IOCInterface, value, SIZE_SMALL);
  566.                if (!stricmp(buffer, "ConfirmOnQuit"))  co->ConfirmOnQuit = Txt2Bool(value);
  567.                if (!stricmp(buffer, "HideGUIElements")) co->HideGUIElements = atoi(value);
  568.                if (!stricmp(buffer, "LocalCharset"))   stccpy(co->LocalCharset, value, SIZE_CTYPE);
  569.                if (!stricmp(buffer, "StackSize"))      co->StackSize = atoi(value);
  570.                if (!stricmp(buffer, "PrintMethod"))    co->PrintMethod = atoi(value);
  571.             }
  572.          }
  573.          fclose(fh);
  574.          return TRUE;
  575.       }
  576.       fclose(fh);
  577.    }
  578.    return FALSE;
  579. }
  580.  
  581. ///
  582. /// CO_GetConfig
  583. //  Fills form data of current section with data from configuration structure
  584. void CO_GetConfig(void)
  585. {
  586.    struct CO_GUIData *gui = &G->CO->GUI;
  587.    int i, modified;
  588.    struct MUI_PenSpec *ps;
  589.  
  590.    switch (G->CO->VisiblePage)
  591.    {
  592.       case 0:
  593.          GetMUIString(CE->RealName        ,gui->ST_REALNAME);
  594.          GetMUIString(CE->EmailAddress    ,gui->ST_EMAIL);
  595.          CE->TimeZone          = GetMUICycle  (gui->CY_TZONE)-12;
  596.          CE->DaylightSaving    = GetMUICheck  (gui->CH_DLSAVING);
  597.          break;
  598.       case 1:
  599.          GetMUIString(CE->SMTP_Server     ,gui->ST_SMTPHOST);
  600.          GetMUIString(CE->SMTP_Domain     ,gui->ST_DOMAIN);
  601.          CE->Allow8bit         = GetMUICheck  (gui->CH_SMTP8BIT);
  602.          CE->Use_SMTP_AUTH     = GetMUICheck  (gui->CH_USESMTPAUTH);
  603.          GetMUIString(CE->SMTP_AUTH_User  ,gui->ST_SMTPAUTHUSER);
  604.          GetMUIString(CE->SMTP_AUTH_Pass  ,gui->ST_SMTPAUTHPASS);
  605.          break;
  606.       case 2:
  607.          CE->PreSelection      = GetMUICycle  (gui->CY_MSGSELECT);
  608.          CE->TransferWindow    = GetMUICycle  (gui->CY_TRANSWIN);
  609.          CE->AvoidDuplicates   = GetMUICheck  (gui->CH_AVOIDDUP);
  610.          CE->UpdateStatus      = GetMUICheck  (gui->CH_UPDSTAT);
  611.          CE->WarnSize          = GetMUIInteger(gui->ST_WARNSIZE);
  612.          CE->CheckMailDelay    = GetMUIInteger(gui->ST_INTERVAL);
  613.          CE->DownloadLarge     = GetMUICheck  (gui->CH_DLLARGE);
  614.          CE->NotifyType        = (GetMUICheck(gui->CH_NOTIREQ) ? NOTI_REQ : 0)
  615.                                + (GetMUICheck(gui->CH_NOTISOUND) ? NOTI_SOUND : 0)
  616.                                + (GetMUICheck(gui->CH_NOTICMD) ? NOTI_CMD : 0);
  617.          GetMUIString(CE->NotifySound         ,gui->ST_NOTISOUND);
  618.          GetMUIString(CE->NotifyCommand       ,gui->ST_NOTICMD);
  619.          break;
  620.       case 3:
  621.          for (i = 0; i < MAXRU; i++) DoMethod(gui->LV_RULES, MUIM_List_GetEntry, i, &(CE->RU[i]));
  622.          break;
  623.       case 4:
  624.          CE->ShowHeader        = GetMUICycle  (gui->CY_HEADER);
  625.          GetMUIString(CE->ShortHeaders        ,gui->ST_HEADERS);
  626.          CE->ShowSenderInfo    = GetMUICycle  (gui->CY_SENDERINFO);
  627.          CE->SigSepLine        = GetMUICycle  (gui->CY_SIGSEPLINE);
  628.          get(gui->CA_COLTEXT, MUIA_Pendisplay_Spec, &ps); CE->ColoredText = *ps;
  629.          get(gui->CA_COL2QUOT, MUIA_Pendisplay_Spec, &ps); CE->Color2ndLevel = *ps;
  630.          CE->DisplayAllTexts   = GetMUICheck  (gui->CH_ALLTEXTS);
  631.          CE->FixedFontEdit     = GetMUICheck  (gui->CH_FIXFEDIT);
  632.          CE->WrapHeader        = GetMUICheck  (gui->CH_WRAPHEAD);
  633.          CE->UseTextstyles     = GetMUICheck  (gui->CH_TEXTSTYLES);
  634.          CE->MultipleWindows   = GetMUICheck  (gui->CH_MULTIWIN);
  635.          GetMUIString(CE->TranslationIn       ,gui->ST_INTRANS);
  636.          break;
  637.       case 5:
  638.          GetMUIString(CE->ReplyTo             ,gui->ST_REPLYTO);
  639.          GetMUIString(CE->Organization        ,gui->ST_ORGAN);
  640.          GetMUIString(CE->ExtraHeaders        ,gui->ST_EXTHEADER);
  641.          GetMUIString(CE->NewIntro            ,gui->ST_HELLOTEXT);
  642.          GetMUIString(CE->Greetings           ,gui->ST_BYETEXT);
  643.          GetMUIString(CE->TranslationOut      ,gui->ST_OUTTRANS);
  644.          CE->EdWrapCol         = GetMUIInteger(gui->ST_EDWRAP);
  645.          CE->EdWrapMode        = GetMUICycle  (gui->CY_EDWRAP);
  646.          GetMUIString(CE->Editor              ,gui->ST_EDITOR);
  647.          CE->LaunchAlways      = GetMUICheck  (gui->CH_LAUNCH);
  648.          break;
  649.       case 6:
  650.          GetMUIString(CE->ReplyHello          ,gui->ST_REPLYHI);
  651.          GetMUIString(CE->ReplyIntro          ,gui->ST_REPLYTEXT);
  652.          GetMUIString(CE->ReplyBye            ,gui->ST_REPLYBYE);
  653.          GetMUIString(CE->AltReplyHello       ,gui->ST_AREPLYHI);
  654.          GetMUIString(CE->AltReplyIntro       ,gui->ST_AREPLYTEXT);
  655.          GetMUIString(CE->AltReplyBye         ,gui->ST_AREPLYBYE);
  656.          GetMUIString(CE->AltReplyPattern     ,gui->ST_AREPLYPAT);
  657.          GetMUIString(CE->MLReplyHello        ,gui->ST_MREPLYHI);
  658.          GetMUIString(CE->MLReplyIntro        ,gui->ST_MREPLYTEXT);
  659.          GetMUIString(CE->MLReplyBye          ,gui->ST_MREPLYBYE);
  660.          GetMUIString(CE->ForwardIntro        ,gui->ST_FWDSTART);
  661.          GetMUIString(CE->ForwardFinish       ,gui->ST_FWDEND);
  662.          CE->QuoteMessage      = GetMUICheck  (gui->CH_QUOTE);
  663.          GetMUIString(CE->QuoteText           ,gui->ST_REPLYCHAR);
  664.          GetMUIString(CE->AltQuoteText        ,gui->ST_ALTQUOTECHAR);
  665.          CE->QuoteEmptyLines   = GetMUICheck  (gui->CH_QUOTEEMPTY);
  666.          CE->CompareAddress    = GetMUICheck  (gui->CH_COMPADDR);
  667.          CE->StripSignature    = GetMUICheck  (gui->CH_STRIPSIG);
  668.          break;
  669.       case 7:
  670.          CE->UseSignature      = GetMUICheck  (gui->CH_USESIG);
  671.          GetMUIString(CE->TagsFile            ,gui->ST_TAGFILE);
  672.          GetMUIString(CE->TagsSeparator       ,gui->ST_TAGSEP);
  673.          get(gui->TE_SIGEDIT, MUIA_TextEditor_HasChanged, &modified);
  674.          if (modified) EditorToFile(gui->TE_SIGEDIT, CreateFilename(SigNames[G->CO->LastSig]), NULL);
  675.          break;
  676.       case 8:
  677.          CE->FolderCols = 1; for (i = 1; i < FOCOLNUM; i++) if (GetMUICheck(gui->CH_FCOLS[i])) CE->FolderCols += (1<<i);
  678.          CE->MessageCols = 1; for (i = 1; i < MACOLNUM; i++) if (GetMUICheck(gui->CH_MCOLS[i])) CE->MessageCols += (1<<i);
  679.          CE->FixedFontList = GetMUICheck(gui->CH_FIXFLIST);
  680.          CE->SwatchBeat    = GetMUICheck(gui->CH_BEAT);
  681.          break;
  682.       case 9:
  683.          GetMUIString(CE->PGPCmdPath          ,gui->ST_PGPCMD);
  684.          GetMUIString(CE->MyPGPID             ,gui->ST_MYPGPID);
  685.          CE->EncryptToSelf     = GetMUICheck  (gui->CH_ENCSELF);
  686.          GetMUIString(CE->ReMailer            ,gui->ST_REMAILER);
  687.          GetMUIString(CE->RMCommands          ,gui->ST_FIRSTLINE);
  688.          GetMUIString(CE->LogfilePath         ,gui->ST_LOGFILE);
  689.          CE->LogfileMode       = GetMUICycle  (gui->CY_LOGMODE);
  690.          CE->SplitLogfile      = GetMUICheck  (gui->CH_SPLITLOG);
  691.          CE->LogAllEvents      = GetMUICheck  (gui->CH_LOGALL);
  692.          break;
  693.       case 10:
  694.          CE->GetOnStartup      = GetMUICheck  (gui->CH_POPSTART);
  695.          CE->SendOnStartup     = GetMUICheck  (gui->CH_SENDSTART);
  696.          CE->CleanupOnStartup  = GetMUICheck  (gui->CH_DELETESTART);
  697.          CE->RemoveOnStartup   = GetMUICheck  (gui->CH_REMOVESTART);
  698.          CE->LoadAllFolders    = GetMUICheck  (gui->CH_LOADALL);
  699.          CE->UpdateNewMail     = GetMUICheck  (gui->CH_MARKNEW);
  700.          CE->CheckBirthdates   = GetMUICheck  (gui->CH_CHECKBD);
  701.          CE->SendOnQuit        = GetMUICheck  (gui->CH_SENDQUIT);
  702.          CE->CleanupOnQuit     = GetMUICheck  (gui->CH_DELETEQUIT);
  703.          CE->RemoveOnQuit      = GetMUICheck  (gui->CH_REMOVEQUIT);
  704.          break;
  705.       case 11:
  706.          GetMUIString(CE->MV[0]->Command      ,gui->ST_DEFVIEWER);
  707.          CE->IdentifyBin       = GetMUICheck  (gui->CH_IDENTBIN);
  708.          GetMUIString(CE->DetachDir           ,gui->ST_DETACHDIR);
  709.          GetMUIString(CE->AttachDir           ,gui->ST_ATTACHDIR);
  710.          break;
  711.       case 12:
  712.          GetMUIString(CE->GalleryDir          ,gui->ST_GALLDIR);
  713.          GetMUIString(CE->MyPictureURL        ,gui->ST_PHOTOURL);
  714.          GetMUIString(CE->NewAddrGroup        ,gui->ST_NEWGROUP);
  715.          GetMUIString(CE->ProxyServer         ,gui->ST_PROXY);
  716.          CE->AddToAddrbook     = GetMUICycle  (gui->CY_ATAB);
  717.          CE->AddMyInfo         = GetMUICheck  (gui->CH_ADDINFO);
  718.          CE->AddrbookCols = 1; for (i = 1; i < ABCOLNUM; i++) if (GetMUICheck(gui->CH_ACOLS[i])) CE->AddrbookCols += (1<<i);
  719.          break;
  720.       case 14:
  721.          GetMUIString(CE->TempDir             ,gui->ST_TEMPDIR);
  722.          CE->IconPositionX     = GetMUIInteger(gui->ST_APPX);
  723.          CE->IconPositionY     = GetMUIInteger(gui->ST_APPY);
  724.          CE->IconifyOnQuit     = GetMUICheck  (gui->CH_CLGADGET);
  725.          CE->Confirm           = GetMUICheck  (gui->CH_CONFIRM);
  726.          CE->ConfirmDelete     = GetMUINumer  (gui->NB_CONFIRMDEL);
  727.          CE->RemoveAtOnce      = GetMUICheck  (gui->CH_REMOVE);
  728.          CE->SaveSent          = GetMUICheck  (gui->CH_SAVESENT);
  729.          CE->MDN_Display       = GetMUIRadio  (gui->RA_MDN_DISP);
  730.          CE->MDN_Process       = GetMUIRadio  (gui->RA_MDN_PROC);
  731.          CE->MDN_Delete        = GetMUIRadio  (gui->RA_MDN_DELE);
  732.          CE->MDN_Filter        = GetMUIRadio  (gui->RA_MDN_RULE);
  733.          CE->SendMDNAtOnce     = GetMUICheck  (gui->CH_SEND_MDN);
  734.          GetMUIText(CE->XPKPack               ,gui->TX_PACKER);
  735.          GetMUIText(CE->XPKPackEncrypt        ,gui->TX_ENCPACK);
  736.          CE->XPKPackEff        = GetMUINumer  (gui->NB_PACKER);
  737.          CE->XPKPackEncryptEff = GetMUINumer  (gui->NB_ENCPACK);
  738.          GetMUIString(CE->PackerCommand       ,gui->ST_ARCHIVER);
  739.          break;
  740.    }
  741. }
  742.  
  743. ///
  744. /// CO_SetConfig
  745. //  Sets current section of configuration structure with data from GUI
  746. void CO_SetConfig(void)
  747. {
  748.    struct CO_GUIData *gui = &G->CO->GUI;
  749.    struct POP3 *pop3;
  750.    int i;
  751.    switch (G->CO->VisiblePage)
  752.    {
  753.       case 0:
  754.          setstring(gui->ST_REALNAME  ,CE->RealName);
  755.          setstring(gui->ST_EMAIL     ,CE->EmailAddress);
  756.          setcycle(gui->CY_TZONE, CE->TimeZone+12);
  757.          setcheckmark(gui->CH_DLSAVING  ,CE->DaylightSaving);
  758.          nnset(gui->ST_POPHOST0, MUIA_String_Contents, CE->P3[0]->Server);
  759.          nnset(gui->ST_PASSWD0,  MUIA_String_Contents, CE->P3[0]->Password);
  760.          break;
  761.       case 1:
  762.          setstring   (gui->ST_SMTPHOST  ,CE->SMTP_Server);
  763.          setstring   (gui->ST_DOMAIN    ,CE->SMTP_Domain);
  764.          setcheckmark(gui->CH_SMTP8BIT  ,CE->Allow8bit);
  765.          setcheckmark(gui->CH_USESMTPAUTH,CE->Use_SMTP_AUTH);
  766.          setstring   (gui->ST_SMTPAUTHUSER,CE->SMTP_AUTH_User);
  767.          setstring   (gui->ST_SMTPAUTHPASS,CE->SMTP_AUTH_Pass);
  768.          DoMethod(gui->LV_POP3, MUIM_List_Clear);
  769.          for (i = 0; i < MAXP3; i++) if (pop3 = CE->P3[i])
  770.          {
  771.             sprintf(pop3->Account, "%s@%s", pop3->User, pop3->Server);
  772.             DoMethod(gui->LV_POP3, MUIM_List_InsertSingle, pop3, MUIV_List_Insert_Bottom);
  773.          }
  774.          break;
  775.       case 2:
  776.          setcheckmark(gui->CH_AVOIDDUP  ,CE->AvoidDuplicates);
  777.          setcycle    (gui->CY_MSGSELECT ,CE->PreSelection);
  778.          setcycle    (gui->CY_TRANSWIN  ,CE->TransferWindow);
  779.          setcheckmark(gui->CH_UPDSTAT   ,CE->UpdateStatus);
  780.          set(gui->ST_WARNSIZE, MUIA_String_Integer, CE->WarnSize);
  781.          set(gui->ST_INTERVAL, MUIA_String_Integer, CE->CheckMailDelay);
  782.          setcheckmark(gui->CH_DLLARGE   ,CE->DownloadLarge);
  783.          setcheckmark(gui->CH_NOTIREQ   ,(CE->NotifyType&NOTI_REQ)!=0);
  784.          setcheckmark(gui->CH_NOTISOUND ,(CE->NotifyType&NOTI_SOUND)!=0);
  785.          setcheckmark(gui->CH_NOTICMD   ,(CE->NotifyType&NOTI_CMD)!=0);
  786.          setstring   (gui->ST_NOTISOUND ,CE->NotifySound);
  787.          setstring   (gui->ST_NOTICMD   ,CE->NotifyCommand);
  788.          break;
  789.       case 3:
  790.          DoMethod(gui->LV_RULES, MUIM_List_Clear);
  791.          for (i = 0; i < MAXRU; i++) if (CE->RU[i]) DoMethod(gui->LV_RULES, MUIM_List_InsertSingle, CE->RU[i], MUIV_List_Insert_Bottom);
  792.          break;
  793.       case 4:
  794.          setcycle    (gui->CY_HEADER    ,CE->ShowHeader);
  795.          setstring   (gui->ST_HEADERS   ,CE->ShortHeaders);
  796.          setcycle    (gui->CY_SENDERINFO,CE->ShowSenderInfo);
  797.          setcycle    (gui->CY_SIGSEPLINE,CE->SigSepLine);
  798.          set(gui->CA_COLTEXT, MUIA_Pendisplay_Spec, &CE->ColoredText);
  799.          set(gui->CA_COL2QUOT, MUIA_Pendisplay_Spec, &CE->Color2ndLevel);
  800.          setcheckmark(gui->CH_ALLTEXTS  ,CE->DisplayAllTexts);
  801.          setcheckmark(gui->CH_FIXFEDIT  ,CE->FixedFontEdit);
  802.          setcheckmark(gui->CH_WRAPHEAD  ,CE->WrapHeader);
  803.          setcheckmark(gui->CH_TEXTSTYLES,CE->UseTextstyles);
  804.          setcheckmark(gui->CH_MULTIWIN  ,CE->MultipleWindows);
  805.          setstring   (gui->ST_INTRANS   ,CE->TranslationIn);
  806.          break;
  807.       case 5:
  808.          setstring   (gui->ST_REPLYTO   ,CE->ReplyTo);
  809.          setstring   (gui->ST_ORGAN     ,CE->Organization);
  810.          setstring   (gui->ST_EXTHEADER ,CE->ExtraHeaders);
  811.          setstring   (gui->ST_HELLOTEXT ,CE->NewIntro);
  812.          setstring   (gui->ST_BYETEXT   ,CE->Greetings);
  813.          setstring   (gui->ST_OUTTRANS  ,CE->TranslationOut);
  814.          set(gui->ST_EDWRAP, MUIA_String_Integer, CE->EdWrapCol);
  815.          setcycle    (gui->CY_EDWRAP    ,CE->EdWrapMode);
  816.          setstring   (gui->ST_EDITOR    ,CE->Editor);
  817.          setcheckmark(gui->CH_LAUNCH    ,CE->LaunchAlways);
  818.          break;
  819.       case 6:
  820.          setstring   (gui->ST_REPLYHI     ,CE->ReplyHello);
  821.          setstring   (gui->ST_REPLYTEXT   ,CE->ReplyIntro);
  822.          setstring   (gui->ST_REPLYBYE    ,CE->ReplyBye);
  823.          setstring   (gui->ST_AREPLYHI    ,CE->AltReplyHello);
  824.          setstring   (gui->ST_AREPLYTEXT  ,CE->AltReplyIntro);
  825.          setstring   (gui->ST_AREPLYBYE   ,CE->AltReplyBye);
  826.          setstring   (gui->ST_AREPLYPAT   ,CE->AltReplyPattern);
  827.          setstring   (gui->ST_MREPLYHI    ,CE->MLReplyHello);
  828.          setstring   (gui->ST_MREPLYTEXT  ,CE->MLReplyIntro);
  829.          setstring   (gui->ST_MREPLYBYE   ,CE->MLReplyBye);
  830.          setstring   (gui->ST_FWDSTART    ,CE->ForwardIntro);
  831.          setstring   (gui->ST_FWDEND      ,CE->ForwardFinish);
  832.          setcheckmark(gui->CH_QUOTE       ,CE->QuoteMessage);
  833.          setstring   (gui->ST_REPLYCHAR   ,CE->QuoteText);
  834.          setstring   (gui->ST_ALTQUOTECHAR,CE->AltQuoteText);
  835.          setcheckmark(gui->CH_QUOTEEMPTY  ,CE->QuoteEmptyLines);
  836.          setcheckmark(gui->CH_COMPADDR    ,CE->CompareAddress);
  837.          setcheckmark(gui->CH_STRIPSIG    ,CE->StripSignature);
  838.          break;
  839.       case 7:
  840.          setcheckmark(gui->CH_USESIG      ,CE->UseSignature);
  841.          setstring   (gui->ST_TAGFILE     ,CE->TagsFile);
  842.          setstring   (gui->ST_TAGSEP      ,CE->TagsSeparator);
  843.          setcycle    (gui->CY_SIGNAT      ,G->CO->LastSig);
  844.          FileToEditor(CreateFilename(SigNames[G->CO->LastSig]), gui->TE_SIGEDIT);
  845.          break;
  846.       case 8:
  847.          for (i = 0; i < FOCOLNUM; i++) setcheckmark(gui->CH_FCOLS[i], (CE->FolderCols & (1<<i)) != 0);
  848.          for (i = 0; i < MACOLNUM; i++) setcheckmark(gui->CH_MCOLS[i], (CE->MessageCols & (1<<i)) != 0);
  849.          setcheckmark(gui->CH_FIXFLIST  ,CE->FixedFontList);
  850.          setcheckmark(gui->CH_BEAT      ,CE->SwatchBeat);
  851.          break;
  852.       case 9:
  853.          setstring   (gui->ST_PGPCMD    ,CE->PGPCmdPath);
  854.          setstring   (gui->ST_MYPGPID   ,CE->MyPGPID);
  855.          setcheckmark(gui->CH_ENCSELF   ,CE->EncryptToSelf);
  856.          setstring   (gui->ST_REMAILER  ,CE->ReMailer);
  857.          setstring   (gui->ST_FIRSTLINE ,CE->RMCommands);
  858.          setstring   (gui->ST_LOGFILE   ,CE->LogfilePath);
  859.          setcycle    (gui->CY_LOGMODE   ,CE->LogfileMode);
  860.          setcheckmark(gui->CH_SPLITLOG  ,CE->SplitLogfile);
  861.          setcheckmark(gui->CH_LOGALL    ,CE->LogAllEvents);
  862.          break;
  863.       case 10:
  864.          setcheckmark(gui->CH_POPSTART   ,CE->GetOnStartup);
  865.          setcheckmark(gui->CH_SENDSTART  ,CE->SendOnStartup);
  866.          setcheckmark(gui->CH_DELETESTART,CE->CleanupOnStartup);
  867.          setcheckmark(gui->CH_REMOVESTART,CE->RemoveOnStartup);
  868.          setcheckmark(gui->CH_LOADALL    ,CE->LoadAllFolders);
  869.          setcheckmark(gui->CH_MARKNEW    ,CE->UpdateNewMail);
  870.          setcheckmark(gui->CH_CHECKBD    ,CE->CheckBirthdates);
  871.          setcheckmark(gui->CH_SENDQUIT   ,CE->SendOnQuit);
  872.          setcheckmark(gui->CH_DELETEQUIT ,CE->CleanupOnQuit);
  873.          setcheckmark(gui->CH_REMOVEQUIT ,CE->RemoveOnQuit);
  874.          break;
  875.       case 11:
  876.          DoMethod(gui->LV_MIME, MUIM_List_Clear);
  877.          for (i = 1; i < MAXMV; i++) if (CE->MV[i]) DoMethod(gui->LV_MIME, MUIM_List_InsertSingle, CE->MV[i], MUIV_List_Insert_Bottom);
  878.          setstring   (gui->ST_DEFVIEWER ,CE->MV[0]->Command);
  879.          setcheckmark(gui->CH_IDENTBIN  ,CE->IdentifyBin);
  880.          setstring   (gui->ST_DETACHDIR ,CE->DetachDir);
  881.          setstring   (gui->ST_ATTACHDIR ,CE->AttachDir);
  882.          break;
  883.       case 12:
  884.          setstring   (gui->ST_GALLDIR   ,CE->GalleryDir);
  885.          setstring   (gui->ST_PHOTOURL  ,CE->MyPictureURL);
  886.          setstring   (gui->ST_NEWGROUP  ,CE->NewAddrGroup);
  887.          setstring   (gui->ST_PROXY     ,CE->ProxyServer);
  888.          setcycle    (gui->CY_ATAB      ,CE->AddToAddrbook);
  889.          setcheckmark(gui->CH_ADDINFO   ,CE->AddMyInfo);
  890.          for (i = 0; i < ABCOLNUM; i++) setcheckmark(gui->CH_ACOLS[i], (CE->AddrbookCols & (1<<i)) != 0);
  891.          break;
  892.       case 13:
  893.          set(G->CO->GUI.LV_REXX, MUIA_List_Active, 0);
  894.          break;
  895.       case 14:
  896.          setstring   (gui->ST_TEMPDIR   ,CE->TempDir);
  897.          set(gui->ST_APPX, MUIA_String_Integer, CE->IconPositionX);
  898.          set(gui->ST_APPY, MUIA_String_Integer, CE->IconPositionY);
  899.          setcheckmark(gui->CH_CLGADGET  ,CE->IconifyOnQuit);
  900.          setcheckmark(gui->CH_CONFIRM   ,CE->Confirm);
  901.          setslider   (gui->NB_CONFIRMDEL,CE->ConfirmDelete);
  902.          setcheckmark(gui->CH_REMOVE    ,CE->RemoveAtOnce);
  903.          setcheckmark(gui->CH_SAVESENT  ,CE->SaveSent);
  904.          setmutex    (gui->RA_MDN_DISP  ,CE->MDN_Display);
  905.          setmutex    (gui->RA_MDN_PROC  ,CE->MDN_Process);
  906.          setmutex    (gui->RA_MDN_DELE  ,CE->MDN_Delete);
  907.          setmutex    (gui->RA_MDN_RULE  ,CE->MDN_Filter);
  908.          setcheckmark(gui->CH_SEND_MDN  ,CE->SendMDNAtOnce);
  909.          set(gui->TX_PACKER , MUIA_Text_Contents, CE->XPKPack);
  910.          set(gui->TX_ENCPACK, MUIA_Text_Contents, CE->XPKPackEncrypt);
  911.          setslider   (gui->NB_PACKER    ,CE->XPKPackEff);
  912.          setslider   (gui->NB_ENCPACK   ,CE->XPKPackEncryptEff);
  913.          setstring   (gui->ST_ARCHIVER  ,CE->PackerCommand);
  914.          break;
  915.    }
  916. }
  917. ///
  918.